//加载bmapi sdk
var _script=document.createElement('script');
_script.setAttribute('type','text/javascript');
_script.setAttribute('src','/wgyyapp/bmapi.js');
document.getElementsByTagName('head')[0].appendChild(_script);



//自动鉴权
let UA = window.navigator.userAgent.toLowerCase();
if(UA.indexOf('qm') != -1){
    var _script1=document.createElement('script');
    _script1.setAttribute('type','text/javascript');
    _script1.setAttribute('src','/wgyyapp/signature_qm.js');
    // _script1.onload = _script1.onreadystatechange=function(){
    //     console.debug("script onload");
    //     autoSignature();
    //     _script1.onload = _script1.onreadystatechange = null;
    // }
    document.getElementsByTagName('head')[0].appendChild(_script1);

}else if(UA.indexOf('dingtalk') != -1){
    var _script1=document.createElement('script');
    _script1.setAttribute('type','text/javascript');
    _script1.setAttribute('src','/wgyyapp/signature_dd.js');
    // _script1.onload = _script1.onreadystatechange=function(){
    //     console.debug("script onload");
    //     dd_signature.autoDDSignature();
    //     _script1.onload = _script1.onreadystatechange = null;
    // }
    document.getElementsByTagName('head')[0].appendChild(_script1);
}